<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>客户风险标记记录表 管理</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<form id="rskCstSignLog_form">
    <div class="fieldset1 tabel_col tabel_col_1 clearFix">

        <div class="fieldBox col_50">
            <div class="label">客户名称</div>
            <div class="field">
                  <span>${prjbscinfo.cstNm}</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">截至日期</div>
            <div class="field">
            <span id="closDtVal" >${logMVO.closDt}</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">支付表编号</div>
            <div class="field">
            <span>${logMVO.paySchNo}</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">设备名称</div>
            <div class="field">
            <span>${dtl.prdNm}</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">设备数量</div>
            <div class="field">
            <span>${dtl.prdQty}</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">设备金额</div>
            <div class="field">
            <span>${priceStr}</span>
            </div>
        </div>
        <div class="fieldBox col_50">
            <div class="label">租金总额</div>
            <div class="field">
            <span>${schM.totalRntAmt}</span>
            </div>
        </div>
  		<div class="fieldBox col_100">
            <div class="sqPanel">
                <div id="detailLogGrid">
                    <div id="ligergrid_detail_log" class="sq-grid"></div>
                </div>
            </div>
	   </div>
</form>
<script>
var detailLogGrid;
var detailLogList = '${detailLogListPage}';

$(function(){
	detailLogList = JSON.parse(detailLogList);
	detailLogListPage(detailLogList);
	var closDt = $("#closDtVal").text();
	if(closDt){
		$("#closDtVal").text(renderDate(null,null,closDt));
	}
});
function detailLogListPage(data){
	detailLogGrid = $("#ligergrid_detail_log").ligerGrid({
	data:data,
     columns: [
         { display: '支付表号', name: 'paySchNo', minWidth: 100 },
         { display: '期次', name: 'lsPd',minWidth: 60,
             render: function (rowdata, rowindex, value, column) {
            	 var h = value;
                 if(value==0){
                      h =   "首期款";
                 }
                     return h;
             }},
         { display: '应付日期', name: 'payDt', render:renderDate, minWidth: 100 },
         { display: '应付金额', name: 'feeAmt', minWidth: 140, render:renderAmt,type:'currency',
        	 totalSummary:
             {
                 render: function (rowdata, column, cell)
                 {
                	 var sum =  parseFloat(rowdata.sum).toFixed(2);
                     return '<div style="color:red">应付合计:' +sum + '</div>';
                 },
                 align: 'left'
             }},
         { display: '实付日期', name: 'arPayDt', render:renderDate, minWidth: 100 },
         { display: '实付金额', name: 'arAmt', minWidth: 100, render:renderAmt,type:'currency',
        	 totalSummary:
             {
                 render: function (rowdata, column, cell)
                 {
                	 var sum =  parseFloat(rowdata.sum).toFixed(2);
                     return '<div style="color:red" >实付合计:' +sum + '</div>';
                 },
                 align: 'left'
             }},
         { display: '逾期金额', name: 'overdueAmt', minWidth:100, render:renderAmt,type:'currency',
        	 totalSummary:
             {
                 render: function (rowdata, column, cell)
                 {
                	 var sum =  parseFloat(rowdata.sum).toFixed(2);
                     return '<div style="color:red" >逾期合计:' +sum + '</div>';
                 },
                 align: 'left'
             }},
         { display: '逾期天数', name: 'overdueDay', minWidth: 100 },
         { display: '应收罚息', name: 'penaltyAmt', render:renderAmt,minWidth: 140, type:'currency',
        	 totalSummary:
             {
                 render: function (rowdata, column, cell)
                 {
                	 var sum =  parseFloat(rowdata.sum).toFixed(2);
                     return '<div style="color:red" >应收罚息合计:' + sum + '</div>';
                 },
                 align: 'left'
             }},
         { display: '实收罚息', name: 'arPenalarAmt', render:renderAmt,minWidth: 100, type:'currency', totalSummary:
         {
             render: function (rowdata, column, cell)
             {
            	 var sum =  parseFloat(rowdata.sum).toFixed(2);
                 return '<div style="color:red" >实收罚息合计:' + sum + '</div>';
             },
             align: 'left'
         } },
         { display: '应收违约金', name: 'breachAmt', render:renderAmt,minWidth: 100, type:'currency',
        	 totalSummary:
             {
                 render: function (rowdata, column, cell)
                 {
                	 var sum =  parseFloat(rowdata.sum).toFixed(2);
                     return '<div style="color:red" >应收违约金合计:' + sum + '</div>';
                 },
                 align: 'left'
             }},
         { display: '实收违约金', name: 'arBreachAmt', render:renderAmt,minWidth: 100, type:'currency',
        	 totalSummary:
             {
                 render: function (rowdata, column, cell)
                 {
                	 var sum =  parseFloat(rowdata.sum).toFixed(2);
                     return '<div style="color:red" >实收违约金合计:' + sum + '</div>';
                 },
                 align: 'left'
             }},
         { display: '来款日期', name: 'paymentDt', render:renderDate, minWidth: 100 },
         { display: '纪要', name: 'paymentWayCdNm', minWidth: 60 },
         { display: '来款金额', name: 'paymentAmt', render:renderAmt,minWidth: 100, type:'currency',
        	 totalSummary:
             {
                 render: function (rowdata, column, cell)
                 {
                	 var sum =  parseFloat(rowdata.sum).toFixed(2);
                     return '<div style="color:red" >来款合计:' + sum + '</div>';
                 },
                 align: 'left'
             }},
   		 
     ],
     usePager: false,
     pageSize:10,
     root:'rows',
     record:'total',
     hideLoadButton : true,
     width: '100%',
     height: '99%',
     heightDiff:-2,
     //isScroll: false,
     checkbox:false,
     enabledEdit: false,
     rownumbers:true
});
}

function renderAmt(rowdata, rowindex, value) {
	value = Number(value);
	if(typeof value =='number'){
    var h="￥" + FormatMoney((parseFloat(value)).toFixed(2));
    return h;
	}
}

//格式化时间
function renderDate(rowdata, index, value){
	var dateStr = "";
	if(null != value&&value!=''){
		var date = new Date(value);
		dateStr = DateUtils.formatDate(date, DateUtils.YYYY_MM_DD);
	}
	return dateStr;
}
</script>
</body>
</html>
